#import <Foundation/Foundation.h>
#import <netinet/in.h>
#import <arpa/inet.h>
#import <SystemConfiguration/SystemConfiguration.h>

#define RECV_BUF_SIZE 262144
// we must ensure it still works when a packet exceeds the buffer size
//#define RECV_BUF_SIZE 26

@interface Connector: NSObject {
    NSInputStream *inStream; 
    NSOutputStream *outStream;
	uint8_t buffer[RECV_BUF_SIZE+1];
}

-(void)init:(NSString *)ip,int port;
-(void)sendStr:(NSString *) s;
-(void)sendData:(NSData *)d;
-(NSString *)recvStr;
-(void)finish;

@end

